using System.Collections;
using System.Collections.Generic;
using TowerDefence_Study;
using UnityEngine;

namespace TowerDefence
{
    public class UISelectLevel : UILayer
    {

        public void EnterBattel(int index)
        {
            this.Close();
            List<TowerInfo>towerInfos = new List<TowerInfo>();
            towerInfos.Add(new TowerInfo()
            {
                Attack = 8,
                AttackAnimName = "AttackMelee2",
                AttackCD = 0.8f,
                AttackRank = 2,
                TowerName = "近战",
                BulletModelName = "",
                BulletMoveSpeed = 0,
                MOdelName = "Warrior_example1"
            });
            towerInfos.Add(new TowerInfo()
            {
                Attack = 3,
                AttackAnimName = "AttackRange1",
                AttackCD = 0.6f,
                AttackRank = 6,
                TowerName = "远程",
                BulletModelName = "bullet",
                BulletMoveSpeed = 6,
                MOdelName = "Archer_example2"
            });
            UIManager.EnterUI<UI_Battle>().InitData("1", towerInfos);
        }
        protected override void OnButtonClick(string name, GameObject obj)
        {
            switch (name)
            {
                case "BackBtn":
                    this.Close();
                    UIManager.EnterUI<UI_Main>();
                    break;
                case "Lv_1Btn":
                case "Lv_2Btn": 
                case "Lv_3Btn":
                case "Lv_4Btn":
                case "Lv_5Btn":
                case "Lv_6Btn":
                case "Lv_7Btn":
                case "Lv_8Btn":
                case "Lv_9Btn":
                   EnterBattel(1);
                    break;
            }
        }
    }
}

